#include "s3c2440.h"
#include "uart.h"

void delay(void)
{
    int i, j;
    for(i = 0; i < 10000; i++)
        for(j = 0; j < 50; j++);
}

void uart_test(void)
{
    uart_init();
    uart_send_string("\r\nuart init.........................OK");
    uart_send_string("\r\nhello, world......................OK");
    uart_printf("\r\n%4d, %#x, %s", 10, 100, "test printf");
    
    uart_send_string("\r\n");
    uart_send_hex(0x123456);
    uart_send_string("\r\n");
    uart_send_dec(123456);
    uart_send_string("\r\n");
    uart_send_bin(0xaf);
    
    uart_send_string("\r\n");
    uart_send_hex(0);
    uart_send_string("\r\n");
    uart_send_dec(0);
    uart_send_string("\r\n");
    uart_send_bin(0);
    
    {
        char str[100];
        uart_recv_string(str);
        uart_printf(str);
    }
    while (1);
}

int main(void)
{
    uart_test();
    return 0;
}
